
using System;
using System.Collections;
using Gnome;
using Gdk;


namespace DiaCanvas
{
	
	public class Canvas:Gnome.Canvas
	{
	
		Gnome.CanvasGroup _root ;
		System.Collections.ArrayList _figures;
		
	
		public Canvas()
		{
			Util.Write("Inicializando Canvas");
			
			this._root = base.Root();
			this._root.CanvasEvent += new Gnome.CanvasEventHandler(CanvasEvent);
			this._figures = new System.Collections.ArrayList();
		
		}
		
		public Gnome.CanvasGroup Root()
		{
			Util.Write("Devolviendo mi Root");
			return this._root;
		}
		
		public void CanvasEvent(object obj, Gnome.CanvasEventArgs args)
		{

			EventButton ev = new EventButton (args.Event.Handle);
			switch (ev.Type) 
			{
				case EventType.MotionNotify:
					break;
			}
		}
		
		public void AddFigure(Figura fig)
		{
			Util.Write("Agregando Figura "+fig.toString());
			this._figures.Add(fig);
			fig.draw();
		}
		
		public void RemoveFigure(Figura fig)
		{
			Util.Write("Retirando Figura "+fig.toString());
			this._figures.Remove(fig);
		}
		
	}
}
